<?php

namespace App\Http\Requests;

use App\Http\Requests\BaseFormRequest;


class ReportSettingRequest extends BaseFormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function scenes()
    {
        $id = $this->input("id");
        return [
            'store'=>[
                'report_table_name' => 'required|unique:t_report_setting',
            ],
            'update'=>[
				'report_table_name' => 'required|unique:t_report_setting,report_table_name,' . $id,
			]
        ];
    }

    public function messages()
    {
        return [
            'report_table_name.required' => '表名不能为空',
            'report_table_name.unique' => '表名已重复',
        ];
    }
}
